package exception;

public class ThrowsDemo {
    public static void main(String[] args)  {
            Studen stu=new Studen();
        try {
            stu.setAge(23);
        } catch (AgeDemo ageDemo) {
            ageDemo.printStackTrace();
        }
        System.out.println("此人的年龄为"+stu.getAge());
    }
}
